<?php 
	include('function/connection.php');
	// Select customer info
	if(isset($_POST['btnSubmit'])){
		$money=$_POST['txtrate'];
		$sql="UPDATE tbl_currency SET money='$money'";
		$result=mysql_query($sql);
		/*if($result){
			pageRedirect("index.php?page=money_rate&action=money_rate&","Exchange Rate updated successful...!");
		}*/
	}
	
	if(isset($_GET['rate'])){
		$sql = "SELECT * FROM  tbl_currency ";
		$result = mysql_query($sql);
		$row = mysql_fetch_array($result);
			$id = $row['id'];
			$rate = $row['money'];	
	}
?>

<form action="index.php?page=money_rate&action=money_rate&rate=1" method="post" >
	<table class="bordered" width="770">
        <thead>
            <tr>
                <th>Please update your exchange rate information:<br /><span class="red">* require feild</span></th>
            </tr>
        </thead>
        <tr>
    	<?php 
			if(isset($_REQUEST['msgStatus']))
				echo " <td ><span class='red'>". $_REQUEST['msgStatus']."</span></td>";
		?>
    </tr>
	</table>
    <table class="bordered" width="770">
		<tr>
        	<td>
            	<label><span class="red">*</span>Exchange Rate:</label>
            </td>
			<td >
            	<input type="hidden" name="txtid" value="<?php echo @$id;?>"  />
				<input type="text" class="txtID" name="txtrate" value="<?php echo @$rate;?>" /> 
            </td>           
		</tr>
		<tr>
        	<td></td>
			<td ><input type="submit" class="btnSubmit" name="btnSubmit" value="Update" />&nbsp; 
            </td>
		</tr>
	</table>
</form>